using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace TimeWar
{
    public class ParticleFactory
    {
        protected Game m_game = null;
        protected GameScreen m_screen = null;
        private static Int32 objCounter;

        public ParticleFactory(Game game, GameScreen screen)
        {
            m_game = game;
            m_screen = screen;
            objCounter = 0;
        }


        protected void manageObjects(ParticleSystem obj)
        {
            m_screen.addScreenParticles(obj);
        }

        protected static Int32 generateObjectId()
        {
            Int32 currId = objCounter;
            objCounter++;
            return currId;
        }

        public ParticleSystem constructParticleSystem(ParticleSystemType p_type, GraphicsDeviceManager p_deviceManager)
        {
            ParticleSystem particleSystem = null;

            if (p_type == ParticleSystemType.Explosion)
            {
                particleSystem = new ExplosionParticleSystem(m_game, generateObjectId());
            }

            return particleSystem;

        }


    }
}